package com.mymarkdown.app.model;

import com.mymarkdown.app.common.annotation.SystemConfigChangeHandler;
import com.mymarkdown.app.common.enums.SystemSettingChangeEventEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * 用户系统设置信息
 * @author zenglun
 *
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class UserSettingInfo {
	/**
	 * 是否自动保存
	 */
	@SystemConfigChangeHandler(SystemSettingChangeEventEnum.CHANGE_AUTO_SAVE)
	private Boolean isAutoSave;

	public static UserSettingInfo empty(){
		return new UserSettingInfo();
	}

	/**
	 * 获取一个默认配置对象
	 * @return
	 */
	public static UserSettingInfo defaultObj() {
		UserSettingInfo empty = empty();
		empty.isAutoSave = false;
		return empty;
	}
}
